1. Field of the Invention
The present invention relates to a technique for detecting a defect in a periodic pattern on an object, which is used, for example, for appearance inspection of semiconductor substrates, printed circuit boards and the like.
2. Description of the Background Art
A variety of inspection methods have been used, conventionally, in a field of appearance inspection of semiconductor substrates, printed circuit boards and the like. Japanese Patent Application Laid Open Gazette No. 60-57929 (Document 1), for example, discloses a method of detecting a defect in an inspection image. In the method, the binary inspection image is moved to a plurality of positions relatively to the binary reference image, the number of pixels having different values between a binary inspection image and a binary reference image are counted up in the relative positions, a positional difference vector (hereinafter, referred to simply as “difference vector”) between the inspection image and the reference image is obtained where the counted number of pixels is minimum, and a positional difference between the two images is corrected with the relative movement of the inspection image by the difference vector. Herein, the difference vector (positional difference vector) refers to a distance (vector) of movement of one of two images for adjustment to make patterns in the two images coincident. Japanese Patent Application Laid Open Gazette No. 61-205811 (Document 2) further discloses a method where a differential image is generated by comparison between a first image and a second image and another differential image is generated by comparison between the second image and a third image, and then the two differential images are compared with each other to detect a defect present in the second image.
In detection of defects by comparison between patterns of dies serving as chips on a semiconductor substrate (hereinafter, referred to as “substrate”), by using the method of Document 2, if the direction of arrangement of dies and the direction of movement of the substrate relative to an image pickup part slightly become out of line, there arises a positional difference in images of a plurality of dies. As a result, for example, when it is intended to sequentially acquire three images and sequentially generate two differential images to compare these differential images with each other, since there is a difference in position between the corresponding pixels of the two differential images, it is impossible to detect any defect with accuracy. Especially, in recent, with miniaturization of patterns on a substrate, the size of defect to be detected becomes smaller and an area on a substrate corresponding to one pixel in an image becomes smaller, and therefore, even if the inclination of the substrate is mechanically corrected, there arises an appreciable level of positional difference among a plurality of acquired images.